package com.dgut.common.excetion;

import com.dgut.common.util.SystemJsonResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


/**
 * 全局异常处理
 */
//@ControllerAdvice
@RestControllerAdvice
public class GlobalException {

    /**
     * 自定义异常处理
     * @return
     */
   @ExceptionHandler(GlobalSystemException.class)
    public SystemJsonResponse ex1(GlobalSystemException e){
       return SystemJsonResponse.fail(e.getCode(),e.getMsg());
   }


}
